package com.kavenka.zhufengfm.app.provider;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by kavenka on 2015/9/27 0027.
 */
public class DBHelper extends SQLiteOpenHelper {

    public static final String DB_NAME = "app.db";
    public static final int VERSION = 1;
    public static final String CREATE_DISCOVER_CATEGORY = "create table "
            + DatabaseContract.TABLE_DISCOVER_CATEGORIES
            + "("
            + DatabaseContract.DiscoverCategories._ID + " INTEGER PRIMARY KEY,"
            + DatabaseContract.DiscoverCategories.NAME + " TEXT NOT NULL,"
            + DatabaseContract.DiscoverCategories.TITLE + " TEXT NOT NULL,"
            + DatabaseContract.DiscoverCategories.IS_CHECKED + " INTEGER,"
            + DatabaseContract.DiscoverCategories.ORDER_NUM + " INTEGER,"
            + DatabaseContract.DiscoverCategories.COVER_PATH + " TEXT,"
            + DatabaseContract.DiscoverCategories.SELECTED_SWITCH + " INTEGER,"
            + DatabaseContract.DiscoverCategories.IS_FINISHED + " INTEGER,"
            + DatabaseContract.DiscoverCategories.CONTENT_TYPE + " TEXT"
            + ")";

    public DBHelper(Context context) {
        super(context, DB_NAME, null, VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_DISCOVER_CATEGORY);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
